<?php defined('SYSPATH') or die('No direct access');


class Core_Exception extends Exception {

	/**
	 * 创建一个新的例外。
	 *
	 *     throw new Core_Exception('Something went terrible wrong, :user',
	 *         array(':user' => $user));
	 *
	 * @param   string
	 * @param   array 
	 * @param   integer 
	 * @return  void
	 */
	public function __construct($message, array $variables = NULL, $code = 0)
	{
		$message = __($message, $variables);
		parent::__construct($message, $code);
	}

	/**
	 * 魔术对象到字符串的方法。
	 *
	 *     echo $exception;
	 * @return  string
	 */
	public function __toString()
	{
		return Core::exception_text($this);
	}

}
